import { _decorator, Component, Node, Sprite, SpriteFrame } from 'cc';
import { aa } from '../frame/FrameCore';
const { ccclass, property } = _decorator;

@ccclass('CountView')
export class CountView extends Component {
    @property(Sprite) sp:Sprite = null;
    @property(SpriteFrame) sf:SpriteFrame[] = [];
    onEnable() {
        this.scheduleOnce(()=>{
            this.sp.spriteFrame = this.sf[0];
            aa.sound.play("countdown")
        },1)
        this.scheduleOnce(()=>{
            this.sp.spriteFrame = this.sf[1];
            aa.sound.play("countdown")
        },2)
        this.scheduleOnce(()=>{
            this.sp.spriteFrame = this.sf[2];
            aa.sound.play("countdownEnd")
        },3)
        this.scheduleOnce(()=>{
            this.sp.spriteFrame = null;
            aa.res.put(this.node);
        },3.5)
    }

    
}

